Skip to content

feat(taxonomy): add publish, localize and unlocalize - #203

Open
reeshika-h wants to merge 2 commits into
developmentfrom
feat/DX-10478-taxonomy-publish
Open

reeshika-h wants to merge 2 commits into
developmentfrom
feat/DX-10478-taxonomy-publish

Conversation

@reeshika-h

Copy link
Copy Markdown
Contributor

Problem

The Python management SDK has no call for the "Publish taxonomies" API
(POST /v3/taxonomies/publish) and none for localizing or unlocalizing a
taxonomy. The only way to remove a taxonomy's localized version was a raw
DELETE taxonomies/{uid}?locale=…, and the same delete() with the locale
missing deletes the whole taxonomy, so a missing argument could silently
destroy data.

Ticket: https://contentstack.atlassian.net/browse/DX-10478

Fix

  • Taxonomy.publish(data) posts the body as given to taxonomies/publish
    (flat {locales, environments, items: [{uid}]}, no api_version or
    scheduled_at, no client-side validation). It is collection-level, so a
    taxonomy bound to a uid is rejected with the new TAXONOMY_UID_NOT_ALLOWED.
    A branch header goes through the existing add_header.
  • The API only acknowledges the request, so the docstring says a 2xx means
    accepted, not published, and points at stack.publish_queue().find() and
    the publish-failure webhooks for the outcome.
  • Taxonomy.localize(data, locale) posts to taxonomies/{uid}?locale=…;
    Taxonomy.unlocalize(locale) sends the DELETE and returns the raw
    response (204, empty body). Both require a uid and a non-blank locale and
    raise ArgumentException before any request is sent, so unlocalize can
    never turn into a whole-taxonomy delete. The locale is required, unlike
    Entry.localize, which defaults to en-us: a default would silently
    target the master locale on a destructive call.
  • Existing methods, including validate_taxonomy_uid, are untouched.
  • Known and left alone: add_header writes to the client-wide
    client.client.headers, so a branch header persists across calls (the
    publish docstring says so); the uid is interpolated into the URL path
    unescaped, as in fetch, update and delete.
  • Tests: 24 unit tests for URLs, verbs, bodies, headers and guards, and five
    live-stack tests in tests/api/taxonomies (publish ×3, localize,
    unlocalize). The live-stack tests have not been run yet: they need a stack
    with environments, locales and a main branch, and the unit tier logs in
    live, so it can time out on a slow network. Snyk did not run locally; CI's
    scan covers it.

publish starts a publish job for one or more taxonomies and is
collection-level, so it is rejected on a taxonomy bound to a uid. The API
only reports that the request was accepted, so the docstring points at the
publish queue for the outcome.

localize and unlocalize are instance-level. Both require a non-blank
locale; unlocalize in particular must not be callable without one, because
a DELETE with no locale removes the whole taxonomy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@reeshika-h
reeshika-h requested a review from a team as a code owner December 4, 2026 12:07
@reeshika-h reeshika-h self-assigned this Dec 4, 2026
@snyk-io

snyk-io Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant